/*****************************************
 *	PropiedadesNivel.h
 * 	Autor: Martin Lucero
 ****************************************/

#ifndef PROPIEDADESNIVEL_H_
#define PROPIEDADESNIVEL_H_

#include <gtkmm/filechooserbutton.h>
#include "VentanaSalidaPajaros.h"
#include "Lienzo.h"

class PropiedadesNivel : public Gtk::Grid {
public:

    PropiedadesNivel();
    ~PropiedadesNivel();

    unsigned getId() const;
    unsigned getMaxAnchura() const;
    unsigned getMaxAltura() const;
    Lienzo* getLienzoNivel() const;

    void agregarLineaSalidaPajaros(unsigned posXinicial, unsigned posYinicial,
            unsigned posXfinal, unsigned posYfinal);

//    void resetear();

//    void guardar(Mundo &mundo);
//    void cargar(const Mundo& mundo);

private:

    class LineaSalidaPajaros {
    public:
        LineaSalidaPajaros(unsigned posXinicial, unsigned posYinicial,
                unsigned posXfinal, unsigned posYfinal);
        ~LineaSalidaPajaros();

        unsigned pos_x_inicial, pos_x_final, pos_y_inicial, pos_y_final;
    };

    void on_id_changed();
    void on_file_set();
    void on_anchura_value_changed();
    void on_altura_value_changed();
    void on_button_generador_clicked();
    
    static unsigned max_id;

    Gtk::FileChooserButton d_FileChooserButton_imagen;
    Gtk::Button d_Button_salidaPajaros;
    Glib::RefPtr<Gtk::Adjustment> ajuste_anchura, ajuste_altura, ajuste_tiempo,
    ajuste_id;
    Gtk::SpinButton d_SpinButton_anchura, d_SpinButton_altura,
    d_SpinButton_tiempo, d_SpinButton_id;

    std::vector<LineaSalidaPajaros*> vec_salidaPajaros;

    VentanaSalidaPajaros *d_window_salidaPajaros;

    Lienzo *lienzo_nivel;
};

#endif